<?php
/**
 * whitepage phone address customer information
 */
class phone_address_model extends CI_Model {
    private $error = array();
    private $is_valid_schema = false;
	/**
	 * constructor to pre load database object
	 */
	function __construct()
	{
		parent::__construct();
		$this->load->database();
	}

    /**
     * every logical scenario should be handle automatically, every action are considered update_address
     * when it is already there, swap between priority one and priority two to reflect address priority change
     *
     * @param $phone
     * @param $name
     * @param $address
     * @param $city
     * @param $state
     * @param $zipcode
     * @param $store_note
     * @param $customer_note
     * @param $address_index
     */
    function update_address($phone, $name, $address, $city, $state, $zipcode, $store_note, $customer_note, $address_index){

    }

    /**
     * @param $phone
     * @return array
     */
	function get_address($phone){
		$address = array();
		
		$this->db->where('phone', $phone);
		$query = $this->db->get('whitepage');
		foreach ($query->result_array() as $row)
		{
    		$address[] = $row;
		}
		return $address;
	}
}
